#include "Graph.h"

using namespace SG::Algebra;
//using SG::Algebra::Graph;

Graph::Graph (const std::vector<std::size_t>& edgeSizes)
{
    auto nodeSize = edgeSizes.size ();
    m_pointer.resize (nodeSize + 1);

    std::size_t totalEdgeSize{ 0 };
    m_pointer[0] = 0;
    int index    = 1;
    for (auto& j : edgeSizes)
    {
        totalEdgeSize += j;
        m_pointer[index] = totalEdgeSize;
        ++index;
    }

    // 指定保存图邻居的数组大小,邻边的数据需要在构造本函数之后确定
    m_neighbour.resize (totalEdgeSize);
}